package demo.service.impl;

import demo.dao.NannyDao;
import demo.dao.impl.NannyDaoImpl;
import demo.entity.Nanny;
import demo.entity.vo.NannyJoinCustomer;
import demo.service.NannyService;

import java.sql.SQLException;
import java.util.Collections;
import java.util.List;

public class NannyServiceImpl implements NannyService {

    private NannyDao nannyDao = new NannyDaoImpl();

    @Override
    public int updateNanny(Nanny nanny) throws SQLException {
        return nannyDao.updateNanny(nanny);
    }

    @Override
    public int deleteNannyById(Integer id) throws SQLException {
        return nannyDao.deleteNannyById(id);
    }

    @Override
    public Nanny queryNannyLikeAddress(String address) throws SQLException {
        return nannyDao.queryNannyLikeAddress(address);
    }

    @Override
    public int insertNanny(Nanny nanny) throws SQLException {
        return nannyDao.insertNanny(nanny);
    }

    @Override
    public List<NannyJoinCustomer> queryNannyJoinCustomer() throws SQLException {
        return nannyDao.queryNannyJoinCustomer();
    }

    @Override
    public Nanny queryNannyById(Integer id) throws SQLException {
        return nannyDao.queryNannyById(id);
    }

    @Override
    public List<Nanny> queryAllNanny() throws SQLException {
        return nannyDao.queryAllNanny();
    }
}
